<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"                  
                xmlns:f="http://java.sun.com/jsf/core"  
                xmlns:p="http://primefaces.org/ui"
                template="./default_template.xhtml">

    <ui:define name="content"> 
        
        <f:view>
            <h:form rendered="#{userController.utilisateur.typeUser == 'Admin'}">
                <h2><h:outputText value="Créer un compte"/></h2>
                
                <h:panelGrid columns="2" class="span4">
                    <h:outputLabel value="Utilisateur  :" for="utilisateur" />  
                    <p:autoComplete id="utilisateur" value="#{userController.selectU}" 
                                    completeMethod="#{userController.completeUsers}"
                                    converter="#{userController.userConverter}" />
                    <h:outputLabel value="Solde:" for="solde" />
                    <h:inputText id="solde" value="#{userController.solde}" title="Solde" />
                    <h:outputLabel value="Type  :" for="typeU" />  
                    <p:selectOneMenu value="#{userController.typeC}" effect="fade" converter="#{userController.typeCompteConverter}" id="typeU">  
                        <f:selectItem itemLabel="" itemValue="" />  
                        <f:selectItems value="#{userController.allTypeCompte}" var="type" itemLabel="#{type.libelleType}" itemValue="#{type}"/>  
                    </p:selectOneMenu>
                    &nbsp;
                    <h:commandButton id="create" value="Créer" action="#{userController.create}" class="btn btn-large btn-primary pull-right" style="margin-top: 20px;" />
                </h:panelGrid>
            </h:form>
        </f:view>

    </ui:define>

</ui:composition>
